<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title><?php echo $title; ?></title>
        <base href="<?php echo $base; ?>" />
        <?php if ($description) { ?>
            <meta name="description" content="<?php echo $description; ?>" />
        <?php } ?>
        <?php if ($keywords) { ?>
            <meta name="keywords" content="<?php echo $keywords; ?>" />
        <?php } ?>
        <?php if ($icon) { ?>
            <link href="<?php echo $icon; ?>" rel="icon" />
        <?php } ?>
        <?php foreach ($links as $link) { ?>
            <link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
        <?php } ?>
        <link type="text/css" rel="stylesheet" href="catalog/view/theme/mobile/stylesheet/jqmop.min.css" />
        <link type="text/css" rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile.structure-1.0.1.min.css" />
        <?php #<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.css" /> ?>
        <link rel="stylesheet" type="text/css" href="catalog/view/theme/mobile/stylesheet/jqmop.simpledialog.min.css" />

        <?php foreach ($styles as $style) { ?>
            <link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
            <?php
        }
        echo $google_analytics;
        ?>
        <link rel="stylesheet" type="text/css" href="catalog/view/theme/mobile/stylesheet/stylesheet.css" media="screen" />
        <?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'product/product') { ?>
            <link rel="stylesheet" type="text/css" href="catalog/view/theme/mobile/stylesheet/photoswipe/photoswipe.css" />
        <?php } ?>
    </head>
    <body>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script type="text/javascript"><!--
<?php
if (isset($this->request->get['route']) &&
   ($this->request->get['route'] != 'checkout/cart') &&
   ($this->request->get['route'] != 'checkout/checkout') &&
   ($this->request->get['route'] != 'account/register') &&
   ($this->request->get['route'] != 'affiliate/register')) {
    ?>
            $(document).ready(function() {
                $.mobile.ajaxEnabled = false;
            });
<?php } ?>
    $(document).ready(function() {
        $("a").attr("rel", "external");
        $(".fancybox").removeAttr("rel");
    });
    //--></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
        <script type="text/javascript" src="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.js"></script>
        <?php #<script type="text/javascript" src="catalog/view/theme/mobile/javascript/jqmop.simpledialog.min.js"></script>    ?>
        <script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
        <script type="text/javascript" src="catalog/view/theme/mobile/javascript/common.js"></script>
        <?php foreach ($scripts as $script) { ?>
            <script type="text/javascript" src="<?php echo $script; ?>"></script>
            <?php
        }
        if (isset($this->request->get['route']) && $this->request->get['route'] == 'product/product') {
            ?>
            <script type="text/javascript" src="catalog/view/javascript/jquery/photoswipe/klass.min.js"></script>
            <script type="text/javascript" src="catalog/view/javascript/jquery/photoswipe/code.photoswipe.jquery-3.0.4.min.js"></script>
            <?php
        }
        ?>
        <div data-role="page" data-theme="a">
            <div data-role="header"<?php echo ($mobile_fixed ? ' data-position="fixed"' : ''); ?>>
                <div class="header ui-grid-a">
                    <div class="ui-block-a">
                        <?php if ($mobile_logo) { ?>
                            <a href="<?php echo $home; ?>">
                                <img src="<?php echo $mobile_logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" />
                            </a>
                        <?php } ?>
                    </div>
                    <div class="ui-block-b" style="text-align: right">
                        <?php
                        echo $language;
                        echo $currency;
                        echo $cart;
                        ?>
                    </div>
                    <div class="Clear"><br /></div>
                </div>
                <div data-role="navbar" data-theme="b">
                    <ul>
                        <li><a data-theme="b" href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
                        <li><a data-theme="b" href="#" id="click_category"><?php echo $text_category; ?></a></li>
                        <li><a data-theme="b" href="#" id="click_search"><?php echo $text_search; ?></a></li>
                        <li><a data-theme="b" href="<?php echo $account; ?>"><?php echo $text_header_account; ?></a></li>
                    </ul>
                </div>
            </div>
            <div id="filter_name_search">
                <input data-theme="c" placeholder="<?php echo $text_search; ?>" type="search" name="filter_name" value="<?php echo (isset($filter_name) && $filter_name ? $filter_name : (isset($search) && $search ? $search : '')); ?>" />
            </div>
            <div id="menu">
                <?php if ($categories) { ?>
                    <ul data-role="listview" data-theme="a">
                        <?php foreach ($categories as $category) { ?>
                            <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
                                <?php if ($category['children']) { ?>
                                    <ul>
                                        <?php for ($i = 0; $i < count($category['children']);) { ?>
                                            <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
                                            <?php for (; $i < $j; ++$i) { ?>
                                                <?php if (isset($category['children'][$i])) { ?>
                                                    <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
                                                <?php } ?>
                                            <?php } ?>
                                        <?php } ?>
                                    </ul>
                                <?php } ?>
                            </li>
                        <?php } ?>
                    </ul><br />
                <?php } ?>
            </div>
            <script type="text/javascript"><!--
                $("#filter_name_search").hide();
                $(document).delegate('#click_search', 'click', function() {
                    $('#filter_name_search').animate({
                        height: 'toggle'
                    }, 500
                );
                });
                $("#menu").hide();
                $(document).delegate('#click_category', 'click', function() {
                    $('#menu').animate({
                        height: 'toggle'
                    }, 500
                );
                });
                
                --></script>
            <div id="notification"></div>
